class Cat():

    def eat(self):
        print("%s 爱吃鱼" % self.name)

    def drink(self):
        print("%s 要喝水" % self.name)


# 创建猫对象
tom = Cat()
tom.name = "Tom"
tom.eat()
tom.drink()
print(tom)

# 再创建一个猫对象
lazy_cat = Cat()
lazy_cat.name = "大懒猫"
lazy_cat.eat()
lazy_cat.drink()

lazy_cat2 = lazy_cat  # 通过 = 赋值，两个变量会指向同一个对象
print(lazy_cat)
print(lazy_cat2)


